/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import cn.webrx.mapper.DbMapper;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootVersion;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p></p>
 * <p>Powered by webrx On 2023-04-27 10:36:06</p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
@SpringBootApplication
@RestController
@Log4j2
public class App {
    @Resource
    DbMapper dm;

    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }

    @GetMapping
    public String index() {
        return "hello 中文 " + SpringBootVersion.getVersion() + dm.version();
    }

    @GetMapping("/dbs")
    public List<String> dbs() {
        log.info("{}",dm.dbs());
        return dm.dbs();
    }
}
